<template>
	<!-- 协议弹出框 -->
	<view class="pop" @touchmove.stop.prevent="">
		<view class="pop-mask" @tap="hidePop"></view>
		<!-- 内容块 -->
		<view class="pop-main">
			<view class="pop-box" v-for="(item,index) in popValue" :key="index" @tap="inValueDetail(item)">
				{{item}}
			</view>
			<view @tap="hidePop" class="pop-box cancel">取消</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			popValueIndex: {
				type: Number,
				default: 0
			}
		},
		data() {
			return {
				animationData: {},
				popValue: [], //
				valueIndex: 0, //父组件点击过来的id
			}
		},
		watch: {
			popValueIndex: {
				handler(index) {
					// console.log(index)
					this.valueIndex = index
					if (index == 0) {
						this.popValue = ["回收员充值", "合伙人充值"]
					} else if (index == 1) {
						this.popValue = ["解冻回收员", "解冻合伙人", "冻结回收员", "冻结合伙人"]
					} else if (index == 2) {
						this.popValue = ["删除回收员", "删除合伙人"]
					} else if (index == 3) {
						this.popValue = ["回收员申请列表", "合伙人申请列表"]
					}
				},
				 immediate: true // 立即执行一次监听器
			}
		},
		methods: {
			hidePop() { //点击关闭遮罩层
				this.$emit("changeData", false)
			},
			inValueDetail(e) {
				console.log(e)
				uni.navigateTo({
					url: `/otherPages/census/auditor/auditor?title=${e}`
				})
				this.hidePop()
			},
		}
	}
</script>

<style lang="scss" scoped>
	.pop {
		position: fixed;
		left: 0;
		top: 0;
		width: 100%;
		height: 100%;
		z-index: 99;

		.pop-mask {
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			background: rgba(0, 0, 0, 0.5);
		}

		.pop-main {
			font-size: 32rpx;
			width: 100%;
			position: absolute;
			bottom: 122rpx;
			background: #fff;
			text-align: center;
			// height:500rpx;
			border-radius: 30rpx 30rpx 0 0;

			.pop-box {
				width: 100%;
				padding: 30rpx 0;
				border-bottom: 2rpx solid #f7f7f7;
			}

			.cancel {
				//取消
				border-bottom: 2rpx solid #e1e1e1;
				color: #8a8a8a;
				font-weight: bold;
				// border: 1px solid #f00;
			}
		}

	}
</style>